#include <bits/stdc++.h>

#include <atcoder/all>
#define LL long long
using namespace std;
using namespace atcoder;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int N;

  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  int last = A[0] - 1, ans = 0;

  for (int i = 0; i < N; i++) {
    if (last >= i) {
      ans++;
      last = max(last, i + A[i] - 1);
    } else {
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}
